package com.sskj.commonapp;

import android.os.Bundle;
import android.view.View;

import com.sskj.common.util.TimeUtil;
import com.trello.rxlifecycle2.components.support.RxAppCompatActivity;

import static com.sskj.common.encrypt.RSAUtils.PRIVATE_KEY;
import static com.sskj.common.encrypt.RSAUtils.PUBLIC_KEY;
import static com.sskj.common.encrypt.RSAUtils.decrypt;
import static com.sskj.common.encrypt.RSAUtils.encrypt;

public class MainActivity extends RxAppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        try {
            String encrypt = encrypt("你好",PUBLIC_KEY );
            System.out.println(encrypt);
            String decrypt = decrypt("kF6HjxT0Ln0LXDbsRiKiXShOfu30L1rRNE6XFfUvYRGuxaKRiQ2UBdM9R2VoPoghBR+MODbKp5QIJHxGL5dNcepAydIAEPkT2ShfDGEQdOQiWo9/jVwAqrx96nUFYkdLCzmg4eyADiY1DWSK1RzISxgsz46zt6eRIeKTyNKHWMA=", PRIVATE_KEY);
            System.out.println(decrypt);

        }catch (Exception e){
            System.out.println(e);
        }
    }

    public void click(View view) {
        TimeUtil.newTime(this)
                .subscribe(i->{
                    System.out.println(i+"");
//                    TextView viewById = findViewById(R.id.tv);
//                    viewById.setText(i+"");
                });

    }
}
